{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1. Fill the missing pieces\n",
    "Fill the `____` parts of the code below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Let's create an empty list\n",
    "my_list = []\n",
    "\n",
    "# Let's add some values\n",
    "my_list.append(\"Python\")\n",
    "my_list.append(\"is ok\")\n",
    "my_list.append(\"sometimes\")\n",
    "\n",
    "# Let's remove 'sometimes'\n",
    "my_list.remove(\"sometimes\")\n",
    "\n",
    "# Let's change the second item\n",
    "my_list[1] = \"is neat\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "# Let's verify that it's correct\n",
    "assert my_list == [\"Python\", \"is neat\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2. Create a new list without modifiying the original one\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "original = [\"I\", \"am\", \"learning\", \"hacking\", \"in\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Your implementation here\n",
    "modified = original[:]\n",
    "modified.append(\"Python\")\n",
    "modified[3] = \"lists\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "assert original == [\"I\", \"am\", \"learning\", \"hacking\", \"in\"]\n",
    "assert modified == [\"I\", \"am\", \"learning\", \"lists\", \"in\", \"Python\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3. Create a merged sorted list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "editable": false
   },
   "outputs": [],
   "source": [
    "list1 = [6, 12, 5]\n",
    "list2 = [6.2, 0, 14, 1]\n",
    "list3 = [0.9]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "my_list= list1+list2+list3\n",
    "my_list.sort(reverse=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "editable": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[14, 12, 6.2, 6, 5, 1, 0.9, 0]\n"
     ]
    }
   ],
   "source": [
    "print(my_list)\n",
    "assert my_list == [14, 12, 6.2, 6, 5, 1, 0.9, 0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
